/*
 * To change this template, choose Tools | Templates
 * and open the template in the editor.
 */
package com.rhythm.commons.asserts;

import static org.junit.Assert.*;

/**
 *
 * @author Michael J. Lee
 */
public class ExceptionAsserts {

    public static void assertExMessage(Throwable ex, String message) {
        assertEquals(ex.getMessage(), message);
    }

    public static void assertExMessageContains(Throwable ex, String message) {
        assertTrue("Throwable message '" + ex.getMessage() +
                "' does not contain '" + message + "'",
                ex.getMessage().toLowerCase().
                contains(message.toLowerCase()));
    }

    public static void assertExMessageContains(Throwable ex, String... words) {
        for (String aWord : words){
            assertExMessageContains(ex, aWord);
        }
    }
}
